home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / xinetd / sio.1.5.6 / Makefile < prev    next >
Encoding:
Makefile  |  1992-12-09  |  4.5 KB  |  171 lines

  1. # (c) Copyright 1992 by Panagiotis Tsirigotis
  2. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  3. # and conditions for redistribution.
  4.  
  5. #
  6. # $Id: Makefile,v 7.10 1992/12/10 06:40:58 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = sio
  24. VERSION            = 1.5.6
  25.  
  26. REAL_HEADERS    = sio.h impl.h events.h
  27. HEADERS            = $(REAL_HEADERS) sioconfig.h
  28. SOURCES            = sprint.c sio.c siosup.c
  29. OBJECTS            = sprint.o sio.o siosup.o
  30.  
  31. MANFILES            = sio.3 Sprint.3
  32. INCLUDEFILES    = sio.h
  33.  
  34. # The following variables are used by the 'install' entry and
  35. # should be customized:
  36. #     LIBDIR:     where the library will be placed
  37. #     INCUDEDIR:  where the include files will be placed
  38. #     MANDIR:     where the man pages will be placed
  39. #
  40. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  41. MANDIR            = $(HOME)/.links/includes
  42. INCLUDEDIR        = $(HOME)/.links/manpages/man3
  43.  
  44. #
  45. # Available flags:
  46. #  -DDEBUG           :  enables assertions in the code. A failed assertion
  47. #                       terminates the program
  48. #  -DEVENTS          :  enables code that records events (currently limited
  49. #                       to which functions have been called on a given fd)
  50. #                       and code that accesses the event buffers.
  51. #  -DLITTLE_ENDIAN   :  says that the machine is a little endian. This is
  52. #                       needed if you enable EVENTS and your machine is a
  53. #                       little endian (big endian is the default).
  54. #    -DCONFIG=type        :    type can be:
  55. #                                    sunos4.1
  56. #                                    ultrix4.1 (works for 4.2 too)
  57. #                                    umipsbsd
  58. #                                    sysv
  59. #                                    bsd43
  60. #
  61. DEFS                =                # used for command line defined flags
  62.  
  63. DEBUG                = -g            # -g or -O
  64. VERSION_DEF        = -DVERSION=\"SIO\ Version\ $(VERSION)\"
  65.  
  66. CPP_DEFS            = $(VERSION_DEF) $(DEFS)
  67.  
  68. #
  69. # The following variables shouldn't need to be changed
  70. #
  71. LINT_FLAGS        = -hbux
  72. CPP_FLAGS        = $(CPP_DEFS)
  73. CC_FLAGS            = $(DEBUG)
  74. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  75.  
  76. INSTALL            = install -c
  77. FMODE                = -m 640            # used by install
  78. RANLIB            = ranlib
  79.  
  80. PAGER                = less
  81.  
  82.  
  83. LIBNAME            = lib$(NAME).a
  84.  
  85. lib: $(LIBNAME)
  86.  
  87. libopt: clean
  88.     make DEBUG=-O lib
  89.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  90.  
  91. $(LIBNAME): $(OBJECTS)
  92.     ar r $@ $?
  93.     $(RANLIB) $@
  94.  
  95. lint:
  96.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  97.  
  98. install: $(LIBNAME)
  99.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  100.     then \
  101.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  102.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  103.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  104.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  105.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  106.         echo Installed $(MANFILES) to $(MANDIR) ;\
  107.     else \
  108.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  109.     fi
  110.  
  111. uninstall:
  112.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  113.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  114.     a=`pwd` ; cd $(LIBDIR) ;\
  115.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  116.     a=`pwd` ; cd $(MANDIR) ;\
  117.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  118.  
  119. clean:
  120.     rm -f $(OBJECTS) $(LIBNAME) core sioconfig.h
  121.  
  122. spotless: clean uninstall
  123.  
  124. tags: $(SOURCES) $(HEADERS)
  125.     ctags -w $(SOURCES) $(HEADERS)
  126.  
  127. checkout:
  128.     co $(SOURCES) $(REAL_HEADERS) $(MANFILES)
  129.  
  130. #
  131. # Distribution section
  132. # This section contains the 2 targets for distribution support: dist, dirs
  133. # "dist" checks out all files to be distributed
  134. # "dirs" prints a list of directories to be included in the distribution.
  135. # These directories should have a Makefile with a "dist" target
  136. #
  137. DISTRIBUTION_FILES    = $(REAL_HEADERS) $(SOURCES) $(MANFILES) README
  138. DIRS                        = Config suite
  139.  
  140. dist:
  141.     -co -q $(DISTRIBUTION_FILES)
  142.  
  143. dirs:
  144.     @echo $(DIRS)
  145.  
  146. #
  147. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  148. #
  149. sprint.o:   sio.h impl.h sioconfig.h
  150. sio.o:      sio.h impl.h sioconfig.h events.h
  151. siosup.o:   sio.h impl.h sioconfig.h events.h
  152.  
  153. #
  154. # The following variables are used to determine the value of CONFIG based
  155. # of the value of ARCH
  156. #
  157. CONFIG_sun3=sunos4.1
  158. CONFIG_sun4=sunos4.1
  159. CONFIG_dec-mips=ultrix4.1
  160. CONFIG_m1000=umipsbsd
  161.  
  162. CONFIG=$(CONFIG_$(ARCH))
  163.  
  164. CONFIG_FILE=$(CONFIG)-config.h
  165.  
  166. sioconfig.h:
  167.     rm -f $@
  168.     ln -s Config/$(CONFIG_FILE) $@
  169.  
  170.